<?php
class RssHandler {
	
	private static $instance = null;
	
	private $inside = false;
	
	private $current = null;
	
	private $count = 0;
	
	private $data = array();
	
	private function __construct(){} 
	
	public static function getInstance(){
		self::$instance = self::$instance == null ? new RssHandler() : self::$instance;
		return self::$instance; 		
	}
	
	function setInsideItem(){ 
		$this->inside = true;
	}
	
	function setOutsideItem(){
		$this->inside = false;
		$this->current = null;
		$this->count++;
	}
	
	function setCurrent($tag){ 
		$this->current = $tag;
	}	
	
	function isInsideItem(){
		return $this->inside;
	}
	
	function addData($data){
		if($this->current && $data){
			$this->data[$this->count][$this->current] .= $data;
		}	
	}
	
	
	function getData(){
		return $this->data;
	}
	
	function getItemsCount(){
		return $this->count;
	}
	

	
	
}
?>